package com.txzhang.springcloud.storageservice.service;

import com.txzhang.springcloud.storageservice.config.Config;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Component
@FeignClient(value = "account-server", configuration = Config.class)
public interface AccountService {

    /**
     * 减少指定账户余额
     * @param userId
     * @param money
     */
    @PostMapping("/account/deduction")
    void deduction(@RequestParam("userId") Integer userId, @RequestParam("money") Integer money);
}
